Database reference guide |
HOME |
SELECT StatementThe essential elements of a basic NSQL query are the SELECT and FROM clauses. The simplest form of query does not require a WHERE statement. The following statement will create a Domain of all records in the customer table and select all the columns in that table: SELECT * FROM Customer;
Obtaining Counts of RecordsTo obtain a count of records, Count(*) or # can be used. The following statements are identical in their execution and will both create a domain of all records in the customer table: SELECT Count(*) FROM Customer; SELECT # FROM Customer; The domains produced by these queries will contain all records in the customer table, but will select no columns for viewing. This is the fastest and simplest way to get a count of the number of records in a Domain. If columns are not required for viewing, then a count query should be executed. Obtaining specified recordsTo select specific columns for viewing in the Domain, simply list them after the SELECT statement. The following statement will return all forenames in the specified table: SELECT Forename FROM Customer;
Up to 100 columns can be specified explicitly in the SELECT clause
SELECT Sex,Age FROM Customer;
|
Online & Instructor-Led Courses | Training Videos | Webinar Recordings | ![]() |
|
![]() |
© Alterian. All Rights Reserved. | Privacy Policy | Legal Notice | ![]() ![]() ![]() |